-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI Tests: Permissions #2625
UI Tests: Permissions #2625
Conversation
…n English phrase and update in test
# Conflicts: # UITests/Common/UITests.swift
@@ -25,6 +25,7 @@ class AddressBarKeyboardShortcutsTests: XCTestCase { | |||
|
|||
private var addressBarTextField: XCUIElement! | |||
override class func setUp() { | |||
UITests.firstRun() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that we always start tests with a fresh install, every time we start a case, we also have to quickly make sure there are no first run problems like permissions which always appear, or the onboarding page.
app.typeKey("n", modifierFlags: .command) | ||
app.typeKey("w", modifierFlags: [.command, .option]) | ||
app.terminate() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove fresh-install first-run startup nuisances for all test cases.
) | ||
self.typeURL(url, pressingEnter: pressingEnter) | ||
} | ||
|
||
func clickAfterExistenceTestSucceeds() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New convenience function.
@@ -246,7 +246,7 @@ class FindInPageTests: XCTestCase { | |||
XCTAssertEqual(statusFieldTextContent, "1 of 4", "Unexpected status field text content after a \"Find in Page\" operation.") | |||
|
|||
let webViewWithSelectedWordsScreenshot = loremIpsumWebView.screenshot() | |||
let highlightedPixelsInScreenshot = webViewWithSelectedWordsScreenshot.image.matchingPixels(of: .findHighlightColor) | |||
let highlightedPixelsInScreenshot = try XCTUnwrap(webViewWithSelectedWordsScreenshot.image.matchingPixels(of: .findHighlightColor)) | |||
XCTAssertGreaterThan( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Standardize unwrap asserts over tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks a lot @Halle! This worked great on my local machine with the exception of test_locationPermissions_whenAlwaysDenyIsSelected_alwaysDenies
that left a system location permission prompt on the screen, but still passing all checks 👍
Let's handle it separately, and merge this for now. 🚢
Yes, I think this will be helpful to have in the tests for now, but the location TCC behavior can definitely be improved, so I will add a subtask explaining that in the project and merge. Thanks very much for checking it out! |
Task/Issue URL: https://app.asana.com/0/1199230911884351/1205717021705373/f Description: Adds a series of UI tests for permissions
Task/Issue URL: https://app.asana.com/0/1199230911884351/1205717021705373/f
Tech Design URL:
CC:
Description: Adds a series of UI tests for permissions
Steps to test this PR:
PermissionsTests
UI Tests general guidelines for everyone:
XCUIAutomation
effectively supports locally (this makes sense if you consider how closed the simulator environment where this API gets the most development is, by contrast with an engineer's development computer). This approach keeps the debug loop fast and the tests free of workaround buildup.xcresult
bundle, even if it seems like the same failure as a previous failure (it may be subtly different). Since thexcresult
bundle will include a screen recording or screenshots, for your privacy, please consider the visibility of things in your system you may not want to send to a contractor when you are running the tests.Thank you very much for your help!